﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WFP_Sandbox.ViewModel.UI_Classes;

namespace WFP_Sandbox.ViewModel.Helper
{
    public class GameComparer : IEqualityComparer<Game>
    {
        private Func<Game, object> m_funcDistinct;

        public GameComparer(Func<Game, object> funcDistinct)
        {
            this.m_funcDistinct = funcDistinct;
        }
        public bool Equals(Game x, Game y)
        {
            return m_funcDistinct(x).Equals(m_funcDistinct(y));
        }

        public int GetHashCode(Game obj)
        {
            return this.m_funcDistinct(obj).GetHashCode();
        }
    }
}
